<?php include 'includes/inc_header_list.php' ?>
<?php include 'includes/inc_header.php' ?>
<?php include 'includes/inc_menu.php' ?>
<div id='cols' class='box'><?php include 'includes/left-column.php' ?></div>
<div id='content' class='box'>
    <h1>Animais</h1>
    <p id='btn-create' class='box'><a href='animal_cad.php'><span>Adicionar Animais</span></a></p>
    <div class='fix'></div>
    <table  class='tablesorter' id="listagem">
        <thead>
            <tr>
                <th scope='col'>Nome</th>
                <th scope='col'>Raça</th>
                <th scope='col'>Tipo</th>
                <th scope='col'>Sexo</th>
                <th scope='col'>Nascimento</th>
                <th scope='col'>Munícipio</th>
                <th scope='col'>Filiação</th>
                <th scope='col' colspan='2'>Ações</th>
            </tr>
        </thead>
        <tfoot>
        </tfoot>
         <?php 
           require_once 'Model/DAO/AnimalDAO.php';
           $animalDAO = new AnimalDAO();
           foreach ($animalDAO->getAllAnimal() as $linhas):
         ?>
        <tbody>
            <tr>
                <td class='t-center'><?=utf8_encode($linhas['nome']); ?></td>
                <td class='t-center'><?=utf8_encode($linhas['raca']); ?></td>
                <td class='t-center'><?=$linhas['tipoAnimal'];?></td>
                <td class='t-center'><?=$linhas['sexo']; ?></td>
                <td class='t-center'><?=$linhas['nascimento'];?></td>
                <td class='t-center'><?=$linhas['municipio'];?></td>
                <td class='t-center'><?= $linhas['pai'] . ' e ' . $linhas['mae'] ?></td>
                <td class='t-center'>
                  <a href='animal_del.php?IDAnimal=<?=$linhas['IDAnimal'];?>'>
                    <img src='img/design/ico-delete.gif' class='ico' alt='Delete' />
                  </a>
                  <a href='animal_edit.php?IDAnimal=<?=$linhas['IDAnimal'];?>'>
                    <img src='img/design/ico-edit.gif' class='ico' alt='Edit' /></a>
                </td>
            </tr>
        </tbody>
        <?php endforeach; ?>
    </table>
</div> 
<?php include 'includes/inc_footer.php'; ?>